import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:myapp/app/theme/app_color.dart';

class ProfileOperateLayout extends StatelessWidget {
  final EdgeInsets? margin;

  ProfileOperateLayout({this.margin});

  Widget _buildItem(String title, IconData icons) {
    return Column(
      children: [
        Icon(
          icons,
          color: AppColor.red80,
        ),
        Padding(
          padding: EdgeInsets.only(top: 5),
          child: Text(
            title,
            style: TextStyle(color: AppColor.hex_333, fontSize: 14),
          ),
        ),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: margin,
      padding: EdgeInsets.all(10),
      width: double.infinity,
      child: Row(
        children: [
          Expanded(child: _buildItem("消息通知", Icons.notifications_active_outlined)),
          Expanded(child: _buildItem("收藏", Icons.star_border_rounded)),
          Expanded(child: _buildItem("浏览历史", Icons.history)),
          Expanded(child: _buildItem("下载管理", Icons.download_outlined)),
        ],
      ),
      decoration: BoxDecoration(
        color: AppColor.white,
        borderRadius: BorderRadius.circular(5),
      ),
    );
  }
}
